import { RequestData, POST } from '@/utils/request-data';

const requestData = Object.create(RequestData);
requestData.setBaseUrl('/erp/dealer/material');

// 素材
export const materialPage = params => requestData.base('/page', POST, params);
export const materialList = params => requestData.base('/list', POST, params);
export const materialAdd = params => requestData.base('/add', POST, params);
export const materialDelete = ids => requestData.base('/delete', POST, ids);
export const materialEdit = params => requestData.base('/edit', POST, params);
export const materialRead = id => requestData.base(`/read/${id}`, POST);
export const materialSku = params => requestData.base('/check/sku', POST, params);
export const materialVariantSku = params => requestData.base('/check/variant/sku', POST, params);
export const materialMove = params => requestData.base('/move', POST, params);

// 素材模板
export const materialTemplatePage = params => requestData.base('/templatePage', POST, params);
export const materialTemplateList = params => requestData.base('/templateList', POST, params);

// 素材分组
export const materialGroupPage = params => requestData.base('/group/page', POST, params);
export const materialGroupList = params => requestData.base('/group/list', POST, params, true);
export const materialGroupAdd = params => requestData.base('/group/add', POST, params);
export const materialGroupDelete = ids => requestData.base(`/group/delete/${ids}`, POST);
export const materialGroupEdit = params => requestData.base('/group/edit', POST, params);
export const materialGroupListLeaf = id => requestData.base('/group/listLeaf', POST, id, true);
export const materialGroupListParent = params => requestData.base('/group/listParent', POST, params);
